package com.jatosoft.poc.priceinquiry.core.service;

import java.util.List;

import com.jatosoft.poc.priceinquiry.core.dao.jpa.GenericJPADao;
import com.jatosoft.poc.priceinquiry.core.domain.Article;
import com.jatosoft.poc.priceinquiry.core.domain.PriceRecord;

public class ArticlePriceService {
	public void addAtricle(Article a){
		genericJPADao.save(a);
	}
	
	public void setGenericJPADao(GenericJPADao genericJPADao) {
		this.genericJPADao = genericJPADao;
	}

	GenericJPADao genericJPADao;

	public List<Article> listArticle() {
		return this.genericJPADao.query("select article from Article as article");
		
	}
	
	public Article getArticleById(String id){
		return genericJPADao.get(id);
	}
	
	public void removePriceRecord(PriceRecord pr){
		genericJPADao.delete(pr);
	}
}
